Optimal. Leaf size=251 \[ -\frac {5 (3 A+i B)}{128 a^3 c^4 f (-\tan (e+f x)+i)}-\frac {-3 B+5 i A}{128 a^3 c^4 f (-\tan (e+f x)+i)^2}+\frac {B+5 i A}{64 a^3 c^4 f (\tan (e+f x)+i)^2}+\frac {A+i B}{96 a^3 c^4 f (-\tan (e+f x)+i)^3}-\frac {2 A-i B}{48 a^3 c^4 f (\tan (e+f x)+i)^3}-\frac {B+i A}{64 a^3 c^4 f (\tan (e+f x)+i)^4}+\frac {5 x (7 A+i B)}{128 a^3 c^4}+\frac {5 A}{32 a^3 c^4 f (\tan (e+f x)+i)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.31, antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3588, 77, 203} \[ -\frac {5 (3 A+i B)}{128 a^3 c^4 f (-\tan (e+f x)+i)}-\frac {-3 B+5 i A}{128 a^3 c^4 f (-\tan (e+f x)+i)^2}+\frac {B+5 i A}{64 a^3 c^4 f (\tan (e+f x)+i)^2}+\frac {A+i B}{96 a^3 c^4 f (-\tan (e+f x)+i)^3}-\frac {2 A-i B}{48 a^3 c^4 f (\tan (e+f x)+i)^3}-\frac {B+i A}{64 a^3 c^4 f (\tan (e+f x)+i)^4}+\frac {5 x (7 A+i B)}{128 a^3 c^4}+\frac {5 A}{32 a^3 c^4 f (\tan (e+f x)+i)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 77
Rule 203
Rule 3588
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^4} \, dx &=\frac {(a c) \operatorname {Subst}\left (\int \frac {A+B x}{(a+i a x)^4 (c-i c x)^5} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \operatorname {Subst}\left (\int \left (\frac {A+i B}{32 a^4 c^5 (-i+x)^4}+\frac {i (5 A+3 i B)}{64 a^4 c^5 (-i+x)^3}-\frac {5 (3 A+i B)}{128 a^4 c^5 (-i+x)^2}+\frac {i A+B}{16 a^4 c^5 (i+x)^5}+\frac {2 A-i B}{16 a^4 c^5 (i+x)^4}-\frac {i (5 A-i B)}{32 a^4 c^5 (i+x)^3}-\frac {5 A}{32 a^4 c^5 (i+x)^2}+\frac {5 (7 A+i B)}{128 a^4 c^5 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {A+i B}{96 a^3 c^4 f (i-\tan (e+f x))^3}-\frac {5 i A-3 B}{128 a^3 c^4 f (i-\tan (e+f x))^2}-\frac {5 (3 A+i B)}{128 a^3 c^4 f (i-\tan (e+f x))}-\frac {i A+B}{64 a^3 c^4 f (i+\tan (e+f x))^4}-\frac {2 A-i B}{48 a^3 c^4 f (i+\tan (e+f x))^3}+\frac {5 i A+B}{64 a^3 c^4 f (i+\tan (e+f x))^2}+\frac {5 A}{32 a^3 c^4 f (i+\tan (e+f x))}+\frac {(5 (7 A+i B)) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{128 a^3 c^4 f}\\ &=\frac {5 (7 A+i B) x}{128 a^3 c^4}+\frac {A+i B}{96 a^3 c^4 f (i-\tan (e+f x))^3}-\frac {5 i A-3 B}{128 a^3 c^4 f (i-\tan (e+f x))^2}-\frac {5 (3 A+i B)}{128 a^3 c^4 f (i-\tan (e+f x))}-\frac {i A+B}{64 a^3 c^4 f (i+\tan (e+f x))^4}-\frac {2 A-i B}{48 a^3 c^4 f (i+\tan (e+f x))^3}+\frac {5 i A+B}{64 a^3 c^4 f (i+\tan (e+f x))^2}+\frac {5 A}{32 a^3 c^4 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 3.51, size = 267, normalized size = 1.06 \[ \frac {\sec ^3(e+f x) (-\cos (4 (e+f x))-i \sin (4 (e+f x))) (60 (A (-7-14 i f x)+B (2 f x+i)) \cos (e+f x)+18 (7 A+9 i B) \cos (3 (e+f x))-420 i A \sin (e+f x)-840 A f x \sin (e+f x)-378 i A \sin (3 (e+f x))-70 i A \sin (5 (e+f x))-7 i A \sin (7 (e+f x))+14 A \cos (5 (e+f x))+A \cos (7 (e+f x))-60 B \sin (e+f x)-120 i B f x \sin (e+f x)+54 B \sin (3 (e+f x))+10 B \sin (5 (e+f x))+B \sin (7 (e+f x))+50 i B \cos (5 (e+f x))+7 i B \cos (7 (e+f x)))}{3072 a^3 c^4 f (\tan (e+f x)-i)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.74, size = 149, normalized size = 0.59 \[ \frac {{\left (120 \, {\left (7 \, A + i \, B\right )} f x e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (-3 i \, A - 3 \, B\right )} e^{\left (14 i \, f x + 14 i \, e\right )} + {\left (-28 i \, A - 20 \, B\right )} e^{\left (12 i \, f x + 12 i \, e\right )} + {\left (-126 i \, A - 54 \, B\right )} e^{\left (10 i \, f x + 10 i \, e\right )} + {\left (-420 i \, A - 60 \, B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + {\left (252 i \, A - 108 \, B\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (42 i \, A - 30 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 4 i \, A - 4 \, B\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{3072 \, a^{3} c^{4} f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 3.85, size = 271, normalized size = 1.08 \[ \frac {\frac {12 \, {\left (35 i \, A - 5 \, B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{3} c^{4}} - \frac {12 \, {\left (35 i \, A - 5 \, B\right )} \log \left (-i \, \tan \left (f x + e\right ) - 1\right )}{a^{3} c^{4}} + \frac {2 \, {\left (385 \, A \tan \left (f x + e\right )^{3} + 55 i \, B \tan \left (f x + e\right )^{3} - 1335 i \, A \tan \left (f x + e\right )^{2} + 225 \, B \tan \left (f x + e\right )^{2} - 1575 \, A \tan \left (f x + e\right ) - 321 i \, B \tan \left (f x + e\right ) + 641 i \, A - 167 \, B\right )}}{a^{3} c^{4} {\left (i \, \tan \left (f x + e\right ) + 1\right )}^{3}} + \frac {-875 i \, A \tan \left (f x + e\right )^{4} + 125 \, B \tan \left (f x + e\right )^{4} + 3980 \, A \tan \left (f x + e\right )^{3} + 500 i \, B \tan \left (f x + e\right )^{3} + 6930 i \, A \tan \left (f x + e\right )^{2} - 702 \, B \tan \left (f x + e\right )^{2} - 5548 \, A \tan \left (f x + e\right ) - 340 i \, B \tan \left (f x + e\right ) - 1771 i \, A - 35 \, B}{a^{3} c^{4} {\left (\tan \left (f x + e\right ) + i\right )}^{4}}}{3072 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.48, size = 397, normalized size = 1.58 \[ \frac {5 A}{32 a^{3} c^{4} f \left (\tan \left (f x +e \right )+i\right )}+\frac {5 i A}{64 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{2}}-\frac {5 \ln \left (\tan \left (f x +e \right )+i\right ) B}{256 f \,a^{3} c^{4}}-\frac {B}{64 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{4}}+\frac {i B}{48 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{3}}+\frac {5 i B}{128 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )}+\frac {B}{64 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{2}}-\frac {A}{24 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{3}}-\frac {i A}{64 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )+i\right )^{4}}-\frac {5 i A}{128 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {3 B}{128 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {15 A}{128 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )}+\frac {35 i \ln \left (\tan \left (f x +e \right )+i\right ) A}{256 f \,a^{3} c^{4}}-\frac {A}{96 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {i B}{96 f \,a^{3} c^{4} \left (\tan \left (f x +e \right )-i\right )^{3}}-\frac {35 i \ln \left (\tan \left (f x +e \right )-i\right ) A}{256 f \,a^{3} c^{4}}+\frac {5 \ln \left (\tan \left (f x +e \right )-i\right ) B}{256 f \,a^{3} c^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: RuntimeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.40, size = 286, normalized size = 1.14 \[ \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-\frac {11\,B}{128\,a^3\,c^4}+\frac {A\,77{}\mathrm {i}}{128\,a^3\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-\frac {5\,B}{48\,a^3\,c^4}+\frac {A\,35{}\mathrm {i}}{48\,a^3\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {35\,A}{48\,a^3\,c^4}+\frac {B\,5{}\mathrm {i}}{48\,a^3\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (-\frac {5\,B}{128\,a^3\,c^4}+\frac {A\,35{}\mathrm {i}}{128\,a^3\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (\frac {35\,A}{128\,a^3\,c^4}+\frac {B\,5{}\mathrm {i}}{128\,a^3\,c^4}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {77\,A}{128\,a^3\,c^4}+\frac {B\,11{}\mathrm {i}}{128\,a^3\,c^4}\right )+\frac {A}{8\,a^3\,c^4}-\frac {B\,1{}\mathrm {i}}{8\,a^3\,c^4}}{f\,\left ({\mathrm {tan}\left (e+f\,x\right )}^7+{\mathrm {tan}\left (e+f\,x\right )}^6\,1{}\mathrm {i}+3\,{\mathrm {tan}\left (e+f\,x\right )}^5+{\mathrm {tan}\left (e+f\,x\right )}^4\,3{}\mathrm {i}+3\,{\mathrm {tan}\left (e+f\,x\right )}^3+{\mathrm {tan}\left (e+f\,x\right )}^2\,3{}\mathrm {i}+\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}+\frac {5\,x\,\left (7\,A+B\,1{}\mathrm {i}\right )}{128\,a^3\,c^4} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 1.26, size = 604, normalized size = 2.41 \[ \begin {cases} - \frac {\left (\left (- 13510798882111488 i A a^{18} c^{24} f^{6} e^{6 i e} + 13510798882111488 B a^{18} c^{24} f^{6} e^{6 i e}\right ) e^{- 6 i f x} + \left (- 141863388262170624 i A a^{18} c^{24} f^{6} e^{8 i e} + 101330991615836160 B a^{18} c^{24} f^{6} e^{8 i e}\right ) e^{- 4 i f x} + \left (- 851180329573023744 i A a^{18} c^{24} f^{6} e^{10 i e} + 364791569817010176 B a^{18} c^{24} f^{6} e^{10 i e}\right ) e^{- 2 i f x} + \left (1418633882621706240 i A a^{18} c^{24} f^{6} e^{14 i e} + 202661983231672320 B a^{18} c^{24} f^{6} e^{14 i e}\right ) e^{2 i f x} + \left (425590164786511872 i A a^{18} c^{24} f^{6} e^{16 i e} + 182395784908505088 B a^{18} c^{24} f^{6} e^{16 i e}\right ) e^{4 i f x} + \left (94575592174780416 i A a^{18} c^{24} f^{6} e^{18 i e} + 67553994410557440 B a^{18} c^{24} f^{6} e^{18 i e}\right ) e^{6 i f x} + \left (10133099161583616 i A a^{18} c^{24} f^{6} e^{20 i e} + 10133099161583616 B a^{18} c^{24} f^{6} e^{20 i e}\right ) e^{8 i f x}\right ) e^{- 12 i e}}{10376293541461622784 a^{21} c^{28} f^{7}} & \text {for}\: 10376293541461622784 a^{21} c^{28} f^{7} e^{12 i e} \neq 0 \\x \left (- \frac {35 A + 5 i B}{128 a^{3} c^{4}} + \frac {\left (A e^{14 i e} + 7 A e^{12 i e} + 21 A e^{10 i e} + 35 A e^{8 i e} + 35 A e^{6 i e} + 21 A e^{4 i e} + 7 A e^{2 i e} + A - i B e^{14 i e} - 5 i B e^{12 i e} - 9 i B e^{10 i e} - 5 i B e^{8 i e} + 5 i B e^{6 i e} + 9 i B e^{4 i e} + 5 i B e^{2 i e} + i B\right ) e^{- 6 i e}}{128 a^{3} c^{4}}\right ) & \text {otherwise} \end {cases} - \frac {x \left (- 35 A - 5 i B\right )}{128 a^{3} c^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________